]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionSystem: Catch import errors
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 17 May 2017 21:57:18 +0000 (23:57 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 17 Jul 2017 11:00:00 +0000 (13:00 +0200)
While we catch errors that occur when calling init(), enable() or
disable(), the import itself can throw an exception, for instance
if the extension imports an unavailable typelib or tries to draw
in a conflicting library.

https://bugzilla.gnome.org/show_bug.cgi?id=781728

js/ui/extensionSystem.js

index fc359e6ace3438a4d1a3404c65129c555c412edd..f25d63ae85f0b3fac8ab58b3610771e57359b5ca 100644 (file)
@@ -225,7 +225,12 @@ function initExtension(uuid) {
     let extensionState = null;
 
     ExtensionUtils.installImporter(extension);
-    extensionModule = extension.imports.extension;
+    try {
+        extensionModule = extension.imports.extension;
+    } catch(e) {
+        logExtensionError(uuid, e);
+        return false;
+    }
 
     if (extensionModule.init) {
         try {